<!DOCTYPE html>
<html lang="en">
<head>
<title>ADMIN</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="../css/layout.css" type="text/css" media="all">
<link rel="stylesheet" href="../css/style.css" type="text/css" media="all">
<script type="text/javascript" src="../js/jquery-1.6.js" ></script>
<script type="text/javascript" src="../js/cufon-yui.js"></script>
<script type="text/javascript" src="../js/cufon-replace.js"></script>
<script type="text/javascript" src="../js/Swis721_Cn_BT_400.font.js"></script>
<script type="text/javascript" src="../js/Swis721_Cn_BT_700.font.js"></script>
<script type="text/javascript" src="../js/tabs.js"></script>

  <!--[if lt IE 9]>
  	<script type="text/javascript" src="js/html5.js"></script>
	<style type="text/css">
		.bg{ behavior: url(js/PIE.htc); }
	</style>
  <![endif]-->
	<!--[if lt IE 7]>
		<div style=' clear: both; text-align:center; position: relative;'>
			<a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie6_countdown_bannercode"><img src="http://www.theie6countdown.com/images/upgrade.jpg" border="0"  alt="" /></a>
		</div>
	<![endif]-->

</head>

<body id="page3">
	<?php
	   session_start();
	   if(isset($_SESSION['CODIGO_ADM'])){
	    $ID_User = $_SESSION['CODIGO_ADM'];   
		    ?> 
	

	<div class="body1">
	<div class="body2">
	<div class="body5">
		<div class="main">
<!-- header -->
                <?php
$link = mysql_connect("localhost","root","")or die("Problemas en la conexion");
mysql_select_db("personalizatuweb", $link);

$result = mysql_query("SELECT * FROM administrador where ID_ADMINISTRADOR='".$ID_User."'", $link) or die("Problemas en la consulta SELECT:".mysql_error());
  
while($row = mysql_fetch_array($result) ){
	$NombreUser= $row['NOMBREADM'];
	$EmailUser= $row['EMAIL'];
}
mysql_close($link);
 ?>
 
 
			<header>
				<div class="wrapper">
				<nav>
            
				<?php	 
 echo "<p style='float:left;'><b><u>DATOS DE ADMINISTRADOR</u></b><br>"; 
 echo"NOMBRE: ".$NombreUser."<br>";
 echo"EMAIL: ".$EmailUser."<br>";

 ?>
					
					<ul id="menu">
						<li id="nav3" class="active"><a>MENU<span>adm</span></a></li>
						<li id="nav4"><a>Mi<span>Cuenta</span></a></li>
				        <li id="nav1"><a href="logoutADM.php">Cerrar<span>Sesion</span></a></li>
					</ul>
				</nav>
				</div>
			</header>
<!-- header end-->
		</div>
	</div>
	</div>
	</div>
	<div class="body3">
		<div class="main">
<!-- content -->
			<article id="content">
				<div class="wrapper">
                <?php 
				
				if($_GET["op"] == 0){ ?> 
                	<h2 class="under">Listado de Sitios Pendientes</h2>
		  <?php 	} else if($_GET["op"] == 1){ ?>
					     <h2 class="under">Listado de Sitios Aprobados</h2>
                   <?php	} else if($_GET["op"] == 2){ ?>
								 <h2 class="under">Listado de Sitios Rechazados</h2>
							<?php	}?>
					<div class="wrapper">
					 <?php //CONSULTA SQL PARA LISTAR LOS SITIOS
					 
$link = mysql_connect("localhost","root","")or die("Problemas en la conexion");
mysql_select_db("personalizatuweb", $link);

$result = mysql_query("SELECT * FROM sitioweb where STATUS='".$_GET["op"]."'", $link) or die("Problemas en la consulta SELECT:".mysql_error()); ?>

	<table border="3" width="700px;">
	<tr>
    <th><u>N°</u></th>
	<th><u>CODIGO SITIO</u></th>
	<th><u>NOMBRE SITIO</u></th>
	<th><u>USUARIO</u></th>
	<th><u>DESCRIPCION</u></th>
	<th><u>URL</u></th>
	</tr>


<?PHP
$contador = 0;
while($row = mysql_fetch_array($result) ){
	$contador ++;
	$ID_sitio= $row['ID_SITIO'];
	$Nombre_sitio= $row['NOMBRESITIO'];
	$ID_User= $row['ID_USUARIO'];
	$Descripcion_sitio= $row['DESCRIPCION'];
	$URL_sitio= $row['URL'];
	 ?>
 			<tr height="100px">
           		<td align="center" ><?PHP echo $contador; ?></td>
            	<td align="center" ><?PHP echo $ID_sitio; ?></td>
                <td align="center" ><?PHP echo $Nombre_sitio; ?></td>
                <td align="center" ><?PHP echo $ID_User; ?></td>
                <td align="center" ><?PHP echo $Descripcion_sitio; ?></td>
                <td align="center" ><a class="link1" href="../<?PHP echo $URL_sitio; ?>">ver Sitio</a></td>
			</tr>


   
<?php	}
mysql_close($link);
 ?>
</table> 
					</div>
				</div>

			</article>
		</div>
	</div>
	<div class="body4">
		
	</div>
		<div class="main">
<!-- footer -->

<!-- footer end -->
		</div>
            <?php	   }else
		   
		   {
		   header ("Location: ../index.html");
		   	}
       ?> 
<script type="text/javascript"> Cufon.now(); </script>
<script>
	$(document).ready(function() {
		tabs.init();
	})
</script>
</body>
</html>